
$(document).ready(function() {
    
	var ue = UE.getEditor('editor');
	
	$(".submit-bt").click(function() {
		var taskId = $.trim($(".input-task-id").val());
		var reportCate = $(".report-sel-cate").val();
		var reportProof = UE.getEditor('editor').getContent();
		
		var idReg = /^[0-9]{10,20}$/;
		if(!idReg.test(taskId)) {
			Utils.msgDialog("请输入正确的任务编号！");
			return;
		} else if(reportCate == 0) {
			Utils.msgDialog("请选择投诉类别！");
			return;
		} else if(reportProof.length < 32) {
			Utils.msgDialog("描述内容不得少于20个字！");
			return;
		}
		
		var param = {
			taskId: taskId,
			reportCate: reportCate,
			reportProof: reportProof,
		};
		AQ.callAQ("reportTask.do", param, function(result) {
			Utils.checkDialog("提交成功！", "查看投诉记录", "返回", function() {
				location.replace("detail-report.html");
			}, function() {});
		}, function(err, code){
			Utils.msgDialog(err);
		});
	});
	
});